
// 云函数入口文件
const cloud = require('wx-server-sdk')
// const db = cloud.database()
cloud.init({
  env: "zmyy-6uke0"
})
// 云函数入口函数

//获取集合符合条件记录数
const db = cloud.database()
exports.main = async (event, context) => {
  let { _openid, form, gzry_addtime } = event
  return await db.collection('info_zmyy').where({
    _openid: _openid, // 填入当前用户 openid
    form: form,
    gzry_addtime: db.command.gt(gzry_addtime)
  }).count()

}